package de.fhtrier.gdw2.ships.game.modules;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;

import de.fhtrier.gdw2.ships.game.Constants;
import de.fhtrier.gdw2.ships.game.World;
import de.fhtrier.gdw2.ships.game.entities.Entity;
import de.fhtrier.gdw2.ships.game.entities.Target;

public class Move extends Module
	{
		private int power;
		private Image pic;
		private int x, y; // Relative Position des Moduls zur Entity

		public Move(int i, int x, int y, Image img)
			{
				power = i;
				pic = img;
				this.x = x;
				this.y = y;
			}

		public Move(Move m)
			{
				power = m.power;
				pic = m.pic;
				x = m.x;
				y = m.y;
			}

		@Override
		public void render(GameContainer container, StateBasedGame game,
				Graphics g)
			{
				pic.draw(x * Constants.COMPONENTSIZE, y
						* Constants.COMPONENTSIZE);
				// TODO: Modul-grafik an der richtigen Position rendern

				// push und pop transform 
			}

		@Override
		public void update(World w, GameContainer container, int delta, Entity e)
			{


			}


		/**
		 * 
		 * Liefert Duplikat des Aufrufers als neues Objekt zurück.
		 * 
		 * @author Wendelin
		 * @param
		 */
		@Override
		public Module duplicateModule()
			{
				return duplicateMove();
			}

		/**
		 * 
		 * dupliziert ein Move-Objekt.
		 * 
		 * @author
		 * @param
		 */
		private Module duplicateMove()
			{
				return new Move(power, x, y, pic.getScaledCopy(1));
			}

	}
